﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RedesII_WMI
{
    public class QueriesForWMI
    {
        private string process = "select CAPTION from Win32_Process";
        private string ram_memory = "Select * from Win32_LogicalDisk";
        private string hard_drive = "select freespace,size,name from Win32_LogicalDisk where DriveType=3";
        private string macAdress = "select macAdress from Win32_NetworkAdapterConfiguration";
        private string processor = "select NAME from Win32_Processor";
        private string system = "SELECT CAPTION FROM Win32_OperatingSystem";

        private string query = "";

        public string Query
        {
            get { return query; }
            set { query = value; }
        }

        /// <summary>Construtor da classe Querys</summary>
        /// <param name="tipoQuery">Parâmetro pra indentificar de qual tabela deve-se 
        /// buscar os dados.</param>
        public QueriesForWMI(TipoQuery tipoQuery)
        {
            switch (tipoQuery)
            {
                case TipoQuery.process:
                    query = process;
                    break;
                case TipoQuery.ram_memory:
                    query = ram_memory;
                    break;
                case TipoQuery.hard_drive:
                    query = hard_drive;
                    break;
                case TipoQuery.mac_adress:
                    query = macAdress;
                    break;
                case TipoQuery.processor:
                    query = processor;
                    break;
                case TipoQuery.system:
                    query = system;
                    break;
                default:
                    break;
            }
        }

    }

    public enum TipoQuery
    {
        process = 1,
        ram_memory = 2,
        hard_drive = 3,
        mac_adress=4,
        processor=5,
        system=6
    }
}
